<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/commons/taglibs.jsp" %>
<%@ taglib uri="/mytags" prefix="mytag" %>
 
 
<s:form id="edit_pubOffice_form" name="edit_pubOffice_form" method="post" action="pubOffice/update.do" enctype="multipart/form-data" onsubmit="return false;">
	<s:hidden id="id" name="id" />
	<table class="form-table">
		<tr>
			<th width="150">名称：</th>
			<td>
			<s:textfield key="name" title="请输入名称主题" cssClass="form-txtinput" size="50" id="name" maxlength="100" value="%{model.name}"/>
			</td>
		</tr>
		<tr>
			<th width="150">类别：</th>
			<td>
			<mytag:select id="lb" title="请输入类别" name="lb" sql="basedata" isSql="false" condition="1" dataType="Long" listKey="id" listValue="name" headerKey="" headerValue="请选择"  onChange="Ext.milan.pagejs.page_pubOffice.changeJl(this)"/>
			</td>
		</tr>
		<tr>
			<th width="150">子类别：</th>
			<td>
				<s:select key="lb2" list="%{#request.lbList}" listKey="id" listValue="name" id="lb2" name="lb2"/>
			</td>
		</tr>
		<tr>
			<th width="150">发布部门：</th>
			<td>
			<mytag:select id="fbbm" title="请输入发布部门" name="fbbm" sql="depttopdata" isSql="false" listKey="deptname" listValue="deptname" headerKey="" headerValue="请选择"/>
			</td>
		</tr>
		<tr>
			<th>查看人员：</th>
			<td>
				<table border="0" cellspacing="1" cellpadding="1">
					<tr>
						<td valign="top" style="border: 0">
							<s:select key="userids" list="users" listKey="userid" listValue="realname" id="selected_users_in_poa" name="userids" multiple="true" size="10" style="width: 130px;"/>
						</td>
						<td valign="top" style="border: 0">
							<div>
								<a class="btn_short" title="点击添加用户" href="javascript:void(0)" 
									onClick="Ext.milan.pagejs.page_pubOffice.selectUsers('selected_users_in_poa')">添加</a>
								<a class="btn_short" title="点击添加用户" href="javascript:void(0)" id="del_user_in_poa_btn" class="btn-short" style="display: none" 
									onClick="Ext.milan.pagejs.page_pubOffice.removeUser()">移除</a>
							</div>
							
							<div style="padding-top: 5px;">
								<a class="btn_short" title="点击添加组用户" href="javascript:void(0)" 
									onClick="Ext.milan.pagejs.page_pubOffice.selectGroupUsers('selected_users_in_poa')">添加</a>
								<a class="btn_short" title="点击删除组用户" href="javascript:void(0)" id="del_user_in_pg_btn" class="btn-short" style="display: none" 
									onClick="Ext.milan.pagejs.page_pubOffice.removeGroupUser()">移除</a>
							</div>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<th width="150">备注：</th>
			<td>
			<s:textarea cssClass="framingtable2" name="memo" cols="30" rows="3" id="memo" maxlength="300" style="behavior: url('js/maxlength.htc');height:60px;"></s:textarea>
			</td>
		</tr>
		<tr>
			<th width="150">已上传附件：</th>
			<td>
				<c:if test="${attach != null}">
			  		<c:forEach items="${attach}" var="item" varStatus="status">
						<div id="${item.attachid}" style="float:left;" fileid='${item.attachid}'>
							<input type="hidden" name="uploadedAttach" value="${item.name}" />
							<input type="hidden" name="uploadedAttachName" value="${item.attachid}"/>
							${item.name}<a href="#" onclick="Ext.milan.pagejs.page_pubInfo.deleteAttach('${item.attachid}','${item.attachid}')"><img src="skins/default/images/icons/ico-delete.gif" /></a>
						</div>
			  		</c:forEach>
			  	</c:if>
			</td>
		</tr>
		<tr>
			<th width="150">附件：</th>
			<td>
				<%--<input name="attachFile" type="file" contenteditable="false" id="attachfile" size="40">&nbsp;附件最大不能超过20.00M--%>
				<div id='attachFiles'></div>
				<div style="clear:both;"></div>
				<div><a title="点击选择附件，单个文件大小不超过20.00MB" class="btn_long" id="attachFile_FileUpload" ></a></div>
				<div style="float:left;margin:2px 0 0 10px;">附件最大不能超过20.00M</div>
			</td>
		</tr>
	</table>
	<div class="win-btn-panel">
	    <a class="btn_short" class="btn_short" href="javascript:void(0)" 
			onclick="Ext.milan.pagejs.page_pubOffice.edit('edit_pubOffice_form')">确 定</a>
		<a class="btn_short" class="btn_short" href="javascript:void(0)" 
			onclick="Ext.milan.pagejs.page_pubOffice.closeWin(false);">取 消</a>
	</div>
</s:form>
<script type="text/javascript"> 
	var selectedUsers = $("selected_users_in_poa");
	if(selectedUsers.length > 0) 
		$('del_user_in_poa_btn').style.display = "";
	
	new Milan.widget.FileComponent(
	{
		container : "attachFile_FileUpload",
		targetCnt : "attachFiles",
		fileMaxCount : 99,
		onSelectedCallback : function(fid)
		{
			Ext.milan.pagejs.page_pubInfo.addAttachment("attachFiles",fid);
		}
	});
</script>
